<%@ include file="/WEB-INF/templates/includes/taglibs.jsp"%>

<c:choose>
    <c:when test="${sr.totalResults gt 0}">
        <c:if test="${showTopPagination}">
            <jsp:include page="pagination.jsp">
                <jsp:param name="sr" value="${sr}"/>
            </jsp:include>
        </c:if>
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Department</th>
                    <th>Role</th>
                </tr>
            </thead>
            <tbody>
                <c:forEach items="${sr.list}" var="cv">
                    <tr>
                        <td>${cv.name}</td>
                        <td>${cv.currentDepartment}</td>
                        <td>${cv.currentRole}</td>
                        <td class="buttons"><a href="<cmsold:out nodeDataName="viewLink" uuidToLink="relative" />.html?cvid=${cv.id}" class="cvlink btn btn-info">Details <span class="icon-eye-open icon-white"></span> </a>
                            <a href="<cmsold:out nodeDataName="editLink" uuidToLink="relative" />.html?cvid=${cv.id}" class="cvlink btn btn-info"/>Edit <span class="icon-pencil icon-white"></span>
                            <a href="<cmsold:out nodeDataName="deleteConfirmationLink" uuidToLink="relative" />.html?cvid=${cv.id}" class="cvlink btn btn-danger">Delete <span class="icon-remove icon-white"></span></a></td>
                    </tr>
                </c:forEach>
            </tbody>
        </table>
        <c:if test="${showBottomPagination}">
            <jsp:include page="pagination.jsp">
                <jsp:param name="sr" value="${sr}"/>
            </jsp:include>
        </c:if>
    </c:when>
    <c:otherwise>
        <p>no CVs found</p>
    </c:otherwise>
</c:choose>
